#include "sLevelResource.h"

namespace sgui
{

DEFINE_FABRIC(fbObjectLevel, 
	new res::sObjectLevel(gui, *file.getName())
);

namespace res
{

const std::wstring sLevelResource::RESOURCE_NAME = L"LVL";

CONTAINER_WRAPPER(sObjectLevel)& sLevelResource::getLevels()
{
	return m_levels;
}

const CONTAINER_WRAPPER(sObjectLevel)& sLevelResource::getLevels() const
{
	return m_levels;
}

#ifdef _EDITOR
void sLevelResource::exportRTTI(rtti::sInfoList& list)
{
    sResource::exportRTTI(list);
}
#endif

void sLevelResource::load(const db::Record &file)
{
	sResource::load(file);
	m_levels.load(file[L"levels"], fabric::fbObjectLevel);
}

void sLevelResource::save(db::Record &file) const
{
	sResource::save(file);
	m_levels.save(file[L"levels"]);
}

void sLevelResource::clear()
{
    sResource::clear();
	m_levels.clear();
}
        
preset::sPreset* sLevelResource::getPreset(const std::wstring& name)
{
    return NULL;
}

sLevelResource::sLevelResource(sGUI&gui, const std::wstring& name) :
    sResource(gui, name),
	m_levels(gui)
{
    //
}

sLevelResource::~sLevelResource()
{
    //
}

};
};